package com.parkwalk.xxx.component.tab;

import java.awt.FlowLayout;

/**
 * @author borball
 * @date 2012-4-29
 * 
 */
public class Page {
	private Menu menu;
	private ToolBar toolbar;
	private TabPanel tabPage;
	private boolean isSelect;
	private String name;

	public Page(String name, TabPanel tabPage) {
		this.name = name;
		this.tabPage = tabPage;
		menu = new Menu(name, this);
		toolbar = new ToolBar();
		toolbar.setLayout(new FlowLayout(FlowLayout.LEFT, 1, 3));
		toolbar.setBounds(2, 2, toolbar.getWidth(), toolbar.getHeight());
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void showPage() {
		tabPage.changto(this);
	}

	public Menu getMenu() {
		return menu;
	}

	public void setMenu(Menu menu) {
		this.menu = menu;
	}

	public ToolBar getToolbar() {
		return toolbar;
	}

	public void setToolbar(ToolBar toolbar) {
		this.toolbar = toolbar;
	}

	public boolean isSelect() {
		return isSelect;
	}

	public void setSelect(boolean isSelect) {
		if (isSelect) {
			menu.selected();
		} else {
			menu.unSelected();
		}
		this.isSelect = isSelect;
	}
}
